<!--
 * @Description: 报工管理-生产报工
 * @Autor: 曹敬涛
 * @Date: 2021-08-16 15:45:18
 * @LastEditors: 商晓彬
 * @LastEditTime: 2022-02-16 11:51:08
-->
<div class="ex-management">
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>生产报工</span>
                </h3>
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <!-- 查询框 -->
                <div class="ui-g">
                    <span class="ui-float-label  quality-dept ui-g-2">
                        <span class="text">任务编号</span>
                        <input id="input" type="text" name="jobNumber" #jobNumberInput="ngModel" pInputText
                            [(ngModel)]="queryInfo.jobNumber">
                    </span>
                    <span class="ui-float-label quality-dept  ui-g-2">
                        <span class="text">规程编号</span>
                        <input id="input" type="text" name="techniqueNumber" #techniqueNumberInput="ngModel" pInputText
                            [(ngModel)]="queryInfo.techniqueNumber">
                    </span>
                    <span class="ui-float-label quality-dept ui-g-2">
                        <span class="text">规程名称</span>
                        <input id="input" name="techniqueName" #techniqueNameInput="ngModel" type="text"
                            name="techniqueNumber" pInputText [(ngModel)]="queryInfo.techniqueName">
                    </span>
                    <span class="ui-float-label quality-dept ui-g-2">
                        <span class="text">工序名称</span>
                        <input id="input" name="processesName" #processesNameInput="ngModel" type="text"
                            name="techniqueNumber" pInputText [(ngModel)]="queryInfo.processesName">
                    </span>
                    <span class="ui-float-label quality-dept ui-g-2">
                        <span class="text">工步名称</span>
                        <input id="input" name="workStepName" #workStepNameInput="ngModel" type="text"
                            name="techniqueNumber" pInputText [(ngModel)]="queryInfo.workStepName">
                    </span>
                    <span class="ui-float-label quality-dept ui-g-2">
                        <span class="text">计划日期</span>
                        <p-calendar [(ngModel)]="queryInfo.time" selectionMode="range" [readonlyInput]="true">
                        </p-calendar>
                    </span>
                    <span class="ui-float-label quality-dept ui-g-2">
                        <span class="text">状态</span>
                        <p-dropdown name="productingStatus" #productingStatusSelect="ngModel"
                            [options]="productingStatus" [(ngModel)]="queryInfo.productingStatus" dataKey="value"
                            [optionLabel]="'label'" placeholder="请选择">
                        </p-dropdown>
                    </span>
                    <span class="ui-float-label quality-dept ui-g-2">
                        <span class="text">装配班组</span>
                        <p-multiSelect (onChange)="unitChangeEv($event.value)" [options]="getOrganizationUnitList"
                            name="organizationUnitDesc" #organizationUnitDescSelect="ngModel"
                            [(ngModel)]="queryInfo.organizationUnitDesc" defaultLabel="请选择" optionLabel="displayName"
                            dataKey="id"></p-multiSelect>
                    </span>
                    <span class="ui-float-label quality-dept ui-g-2">
                        <span class="text">装配人员</span>
                        <p-multiSelect [options]="getOrganizationUnitUsersByIdList" name="userName"
                            #userNameSelect="ngModel" [(ngModel)]="queryInfo.userName" defaultLabel="请选择"
                            optionLabel="name" dataKey="id">
                        </p-multiSelect>
                    </span>
                    <span class="ui-float-label quality-dept ui-g-2">
                        <span class="text">装配日期</span>
                        <p-calendar [(ngModel)]="queryInfo.assemblyTime" selectionMode="range" [readonlyInput]="true">
                        </p-calendar>
                    </span>
                    <p-button label="查询" (click)="getDescList($event)" class="query-btn"></p-button>
                    <p-button type="button" label="重置" (click)="reset()" class="reset-btn"></p-button>
                </div>
                <div>
                    <p-button *ngIf="'Pages.ProductionReport.MaintenanceCrew' | permission" class="add-btn" (click)="crewVisible=true" label="维护班组人员"></p-button>
                </div>
                <!-- 列表 -->
                <div class="row align-items-center" style="margin-top: 25px;">
                    <div class="primeng-datatable-container">
                        <p-table #dataTable [value]="primengTableHelper.records"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" (onLazyLoad)="getDescList($event)"
                            [paginator]="false" [lazy]="true" [scrollable]="true" [(selection)]="selectRow"
                            [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header" let-car>
                                <tr>
                                    <th style="width: 120px">操作</th>

                                    <th style="width: 80px">
                                        选择
                                    </th>
                                    <th style="width: 80px">序号</th>
                                    <th style="width: 110px">任务编号</th>
                                    <th style="width: 110px">型号</th>
                                    <th style="width: 110px">发次</th>
                                    <th style="width: 110px">规程编号</th>
                                    <th style="width: 110px">规程名称</th>
                                    <th style="width: 110px">工序图号</th>
                                    <th style="width: 110px">工序名称</th>
                                    <th style="width: 110px">工步图号</th>
                                    <th style="width: 350px">工步内容</th>
                                    <th style="width: 110px">标准工时</th>
                                    <th style="width: 110px">配套状况</th>
                                    <th style="width: 110px">计划开始日期</th>
                                    <th style="width: 110px">计划完成日期</th>
                                    <th style="width: 110px">状态</th>
                                    <th style="width: 110px">装配班组</th>
                                    <th style="width: 110px">装配人员</th>
                                    <th style="width: 110px">装配开始日期</th>
                                    <th style="width: 110px">装配完成日期</th>
                                    <th style="width: 110px">工时提报</th>
                                    <th style="width: 110px">调度员</th>
                                    <th style="width: 110px">下发时间</th>
                                    <th style="width: 110px">备注</th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-rowIndex="rowIndex" let-car>
                                <tr>
                                    <td style="width: 120px">
                                        <div class="btn-group dropdown" dropdown container="body">
                                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                                                <i class="fa fa-cog"></i><span class="caret"></span> 操作
                                            </button>
                                            <ul class="dropdown-menu" *dropdownMenu>
                                                <li>
                                                    <a *ngIf="'Pages.ProductionReport.Resume' | permission" href="javascript:;" (click)="llVisibleEv(car.id)">履历</a>
                                                </li>
                                                <li *ngIf="car.productingStatusDesc != '已完成'">
                                                    <a href="javascript:;" *ngIf="'Pages.ProductionReport.Revoke' | permission"
                                                        (click)="cancelVisible = true;cancelInfo=car">撤销</a>
                                                </li>
                                                <li *ngIf="car.productingStatusDesc != '已完成'">
                                                    <a href="javascript:;" *ngIf="'Pages.ProductionReport.Start' | permission" (click)="startReport(car.id)">开始</a>
                                                </li>
                                                <li>
                                                    <a href="javascript:;" *ngIf="'Pages.ProductionReport.See' | permission" (click)="watchTaskByIdEv(car.id)">查看</a>
                                                </li>
                                                <li *ngIf="car.productingStatusDesc != '已完成'">
                                                    <a href="javascript:;" *ngIf="'Pages.ProductionReport.ProductionReport' | permission" (click)="getTaskByIdEv(car.id)">生产报工</a>
                                                </li>
                                                <li>
                                                    <a href="javascript:;" *ngIf="'Pages.ProductionReport.AbnormalReporting' | permission"
                                                        (click)="addVisible=true;addInfoUi.taskCode = car">异常提报</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td style="width: 80px">
                                        <p-tableCheckbox [value]="car"></p-tableCheckbox>
                                    </td>
                                    <td style="width: 80px">{{rowIndex+1}}</td>
                                    <td style="width: 110px">{{car.jobNumber}}</td>
                                    <td style="width: 110px">{{car.model}}</td>
                                    <td style="width: 110px">{{car.lotNo}}</td>
                                    <td style="width: 110px">{{car.techniqueNumber}}</td>
                                    <td style="width: 110px">{{car.techniqueName}}</td>
                                    <td style="width: 110px">{{car.drawingNo}}</td>
                                    <td style="width: 110px">{{car.productionName}}</td>
                                    <td style="width: 110px">{{car.workStepDrawingNo}}</td>
                                    <td style="width: 350px">{{car.workStepName}}</td>
                                    <td style="width: 110px">{{car.workingHour}}</td>
                                    <td style="width: 110px">{{car.matchingCondition}}</td>
                                    <td style="width: 110px">{{car.startTime |date:'yyyy-MM-dd'}}</td>
                                    <td style="width: 110px">{{car.endTime |date:'yyyy-MM-dd'}}</td>
                                    <td style="width: 110px">{{car.productingStatusDesc}}</td>
                                    <td style="width: 110px">{{car.organizationUnitDesc}}</td>
                                    <td style="width: 110px">{{car.userName}}</td>
                                    <td style="width: 110px">{{car.assemblyStartTime|date:'yyyy-MM-dd'}}</td>
                                    <td style="width: 110px">{{car.assemblyEndTime|date:'yyyy-MM-dd'}}</td>
                                    <td style="width: 110px">{{car.productedStatusDesc}}</td>
                                    <td style="width: 110px">{{car.dispatcherName}}</td>
                                    <td style="width: 110px">{{car.issueTime|date:'yyyy-MM-dd'}}</td>
                                    <td style="width: 110px">{{car.remark}}</td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                (onPageChange)="getDescList($event)"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 异常提报 -->
    <!-- <p-dialog header="异常提报" [(visible)]="addVisible" (onHide)="displayclose()" modal="modal" [responsive]="true">
    <form #addForm="ngForm" (ngSubmit)="addStandardDesc()" novalidate class="add-form" autocomplete="off">
      <div class="ui-g">
        <div class="p-field ml ui-g-6">
          <span class="input-lable" style="margin-right: 5px;">*一级异常：</span>
          <p-dropdown name="inspectionTypeDescId" #inspectionTypeDescIdSelect="ngModel" [options]="typeDescList"
            [(ngModel)]="addInfoUi.inspectionTypeDescId" dataKey="id" [filter]="true" filterBy="label"
            [optionLabel]="'typeName'" placeholder="请选择" required>
          </p-dropdown>
          <validation-messages [formCtrl]="inspectionTypeDescIdSelect"></validation-messages>
        </div>
        <div class="p-field ml ui-g-6">
          <span class="input-lable" style="margin-right: 5px;">*二级异常：</span>
          <p-dropdown name="inspectionItemInfoId" #inspectionItemInfoIdSelect="ngModel" [options]="itemInfoList"
            [(ngModel)]="addInfoUi.inspectionItemInfoId" dataKey="id" [filter]="true" filterBy="label"
            [optionLabel]="'itemName'" placeholder="请选择" required>
          </p-dropdown>
          <validation-messages [formCtrl]="inspectionItemInfoIdSelect"></validation-messages>
        </div>
        <div class="p-field ml ui-g-6">
          <span class="input-lable" style="margin-right: 5px;">*异常等级：</span>
          <p-dropdown name="inspectionSeverityDescId" #inspectionSeverityDescIdSelect="ngModel"
            [options]="severityDescList" [(ngModel)]="addInfoUi.inspectionSeverityDescId" dataKey="id" [filter]="true"
            filterBy="label" [optionLabel]="'severityName'" placeholder="请选择" required>
          </p-dropdown>
          <validation-messages [formCtrl]="inspectionSeverityDescIdSelect"></validation-messages>
        </div>
        <div class="p-field ml ui-g-6">
          <span class="input-lable" style="margin-right: 5px;">*指派处理人：</span>
          <p-dropdown name="submitterId" #submitterIdSelect="ngModel" [options]="userList"
            [(ngModel)]="addInfoUi.handlerId" dataKey="id" [filter]="true" filterBy="label" [optionLabel]="name"
            placeholder="请选择" required>
          </p-dropdown>
          <validation-messages [formCtrl]="submitterIdSelect"></validation-messages>
        </div>
        <div class="p-field ml ui-g-12">
          <span class="input-lable" style="margin-right: 5px;">*异常描述：</span>
          <input name="definition" id="model" type="text" size="30" pInputText [(ngModel)]="addInfoUi.inspectionDetails"
            #definitionInput="ngModel" required>
          <validation-messages [formCtrl]="definitionInput"></validation-messages>
        </div>
        <p class="add-upload  ui-g-12">支持PNG格式，最多上传5张</p>
      
        <p-fileUpload customUpload="true" chooseLabel="请选择上传图片" (uploadHandler)="myUploader($event)"
          (onUpload)="onUpload($event)" [(files)]="uploadedFiles" (onRemove)="myRemove($event)" multiple="false"
          auto="auto" accept="image/*" maxFileSize="1000000">
        </p-fileUpload>

      </div>
      <div class="modal-footer">
        <button type="submit" class="btn btn-primary" [disabled]="!addForm.form.valid" [buttonBusy]="savingAddDia"
          [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
          <span>提交</span></button>
      </div>
    </form>
  </p-dialog> -->

    <!-- 异常提报 -->
    <p-dialog [style]="{width: '60%', height: '70%',background:'#fff'}" header="异常提报" [(visible)]="addVisible"
        (onHide)="displayclose()" modal="modal" [responsive]="true">
        <form #addForm="ngForm" (ngSubmit)="addStandardDesc()" novalidate class="add-form" autocomplete="off">
            <div>
                <div style="display: flex;">
                    <div class="p-field ml" style="display: flex;">
                        <span class="input-lable" style="margin-right: 5px;">*编码规则：</span>
                        <p-dropdown name="codeFormatId" #codeFormatIdSelect="ngModel" [options]="formatDropList"
                            [(ngModel)]="addInfoUi.codeFormatId" dataKey="id" [filter]="true" filterBy="label"
                            [optionLabel]="'sysRules'" placeholder="请选择" required>
                        </p-dropdown>
                        <validation-messages [formCtrl]="codeFormatIdSelect"></validation-messages>

                    </div>
                    <div class="p-field ml" style="display: flex;">
                        <span class="input-lable" style="margin-right: 5px;">*一级异常：</span>
                        <p-dropdown name="inspectionTypeDescId" #inspectionTypeDescIdSelect="ngModel"
                            [options]="typeDescList" [(ngModel)]="addInfoUi.inspectionTypeDescId" [filter]="true"
                            filterBy="label" [optionLabel]="'typeName'" placeholder="请选择" required>
                        </p-dropdown>
                        <validation-messages [formCtrl]="inspectionTypeDescIdSelect"></validation-messages>
                    </div>
                    <div class="p-field ml" style="display: flex;">
                        <span class="input-lable" style="margin-right: 5px;">*二级异常：</span>
                        <p-dropdown name="inspectionItemInfoId" #inspectionItemInfoIdSelect="ngModel"
                            [options]="itemInfoList" [(ngModel)]="addInfoUi.inspectionItemInfoId" dataKey="id"
                            [filter]="true" filterBy="label" [optionLabel]="'itemName'" placeholder="请选择" required>
                        </p-dropdown>
                        <validation-messages [formCtrl]="inspectionItemInfoIdSelect"></validation-messages>

                    </div>
                    <div class="p-field ml" style="display: flex;">
                        <span class="input-lable" style="margin-right: 5px;">*异常等级：</span>
                        <p-dropdown name="inspectionSeverityDescId" #inspectionSeverityDescIdSelect="ngModel"
                            [options]="severityDescList" [(ngModel)]="addInfoUi.inspectionSeverityDescId" dataKey="id"
                            [filter]="true" filterBy="label" [optionLabel]="'severityName'" placeholder="请选择" required>
                        </p-dropdown>
                        <validation-messages [formCtrl]="inspectionSeverityDescIdSelect"></validation-messages>
                    </div>
                </div>


                <div style="display: flex;">
                    <div class="p-field ml" style="display: flex;">
                        <span class="input-lable" style="margin-right: 5px;">指派处理人：</span>
                        <p-dropdown name="submitterId" #submitterIdInput="ngModel" [options]="userList"
                            [(ngModel)]="addInfoUi.handlerId" dataKey="id" [filter]="true" filterBy="label"
                            [optionLabel]="'name'" placeholder="请选择">
                        </p-dropdown>

                    </div>
                    <div class="p-field ml" style="display: flex;">
                        <span class="input-lable" style="margin-right: 5px;">*异常描述：</span>
                        <input name="definition" id="model" type="text" size="30" pInputText style="height: 35px;"
                            [(ngModel)]="addInfoUi.inspectionDetails" #definitionInput="ngModel" required>
                        <validation-messages [formCtrl]="definitionInput"></validation-messages>

                    </div>

                </div>
                <p class="add-upload">支持PNG格式，最多上传5张</p>
                <p-fileUpload customUpload="true" chooseLabel="请选择上传图片" (onUpload)="onUpload($event)"
                    [(files)]="uploadedFiles" multiple="false" auto="auto" accept="image/*" maxFileSize="1000000">
                    <ng-template let-file pTemplate="file">
                        <div class="ui-fileupload-files ng-star-inserted">
                            <div class="ng-star-inserted">
                                <div class="ui-fileupload-row ng-star-inserted">
                                    <div>
                                        <img [src]="file.objectURL" width="50" class="ng-star-inserted">
                                    </div>
                                    <div> {{file.name}}</div>
                                    <!-- <div>{{file.size}}</div> -->
                                    <div (click)="remoteFile(file)">
                                        <button icon="pi pi-times" pbutton="" type="button"
                                            ng-reflect-icon="pi pi-times"
                                            class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only">
                                            <span aria-hidden="true"
                                                class="ui-button-icon-left ui-clickable pi pi-times">
                                            </span>
                                            <span class="ui-button-text ui-clickable">ui-btn</span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </ng-template>
                </p-fileUpload>




            </div>
            <div class="modal-footer">
                <!-- <button type="submit" class="btn btn-primary" [disabled]="!addForm.form.valid" [buttonBusy]="savingAddDia"
      [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
      <span>提交</span></button> -->
                <button type="submit" class="btn btn-primary" [disabled]="!addForm.form.valid"
                    [buttonBusy]="savingAddDia" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
                    <span>提交</span></button>
            </div>
        </form>
    </p-dialog>

    <!-- 报工任务 -->
    <p-dialog [header]="taskTitle" [style]="{width: '90%', height: '70%',background:'#fff'}" [(visible)]="reportingVisible" modal="modal" [responsive]="true">
        <div *ngIf="taskInfo">
            <div class="ui-g">
                <span class="ui-float-label  quality-dept ui-g-3">
                    <span class="text">任务编号</span>
                    <input id="input" type="text" readonly disabled pInputText [(ngModel)]="taskInfo.jobNumber">
                </span>
                <span class="ui-float-label quality-dept  ui-g-3">
                    <span class="text">规程编号</span>
                    <input id="input" type="text" readonly disabled pInputText [(ngModel)]="taskInfo.techniqueNumber">
                </span>
                <span class="ui-float-label quality-dept ui-g-3">
                    <span class="text">规程名称</span>
                    <input id="input" readonly disabled type="text" pInputText [(ngModel)]="taskInfo.techniqueName">
                </span>
                <span class="ui-float-label quality-dept ui-g-3">
                    <span class="text">工序名称</span>
                    <input id="input" readonly disabled type="text" pInputText [(ngModel)]="taskInfo.productionName">
                </span>
                <span class="ui-float-label quality-dept ui-g-3">
                    <span class="text">工步名称</span>
                    <input id="input" readonly disabled type="text" pInputText [(ngModel)]="taskInfo.workStepName">
                </span>
                <span class="ui-float-label quality-dept ui-g-3">
                    <span class="text">标准工时</span>
                    <input id="input" readonly disabled type="text" pInputText [(ngModel)]="taskInfo.workingHour">
                </span>
                <span class="ui-float-label quality-dept ui-g-3">
                    <span class="text">装配班组</span>
                    <input id="input" readonly disabled type="text" pInputText
                        [(ngModel)]="taskInfo.organizationUnitDesc">
                </span>
                <span class="ui-float-label quality-dept ui-g-3">
                    <span class="text">装配人员</span>
                    <input id="input" readonly disabled type="text" pInputText [(ngModel)]="taskInfo.userName">
                </span>
                <span class="ui-float-label quality-dept ui-g-3">
                    <span class="text">绩效工时</span>
                    <input id="input" readonly disabled type="text" pInputText [(ngModel)]="taskInfo.performanceHour">
                </span>
            </div>
            <button *ngIf="taskTitle != '生产报工查看'" pButton type="button" icon="pi pi-plus" (click)="addEv()" label="添加报工人"></button>
            <p-table *ngIf="flag" [value]="taskInfo.jobWorkers" [(selection)]="selectTablelist" [paginator]="false">
                <ng-template pTemplate="header">
                    <tr>
                        <th style="width: 80px" *ngIf="taskTitle != '生产报工查看'">
                            <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                        </th>
                        <th style="width: 80px">序号</th>
                        <th style="width: 110px">装配班组</th>
                        <th style="width: 110px">装配人员</th>
                        <th style="width: 110px">绩效工时</th>
                        <th style="width: 110px">报工时间</th>
                        <th style="width: 210px">报工工时</th>
                        <th style="width: 110px" *ngIf="taskTitle != '生产报工查看'">操作</th>
                    </tr>
                </ng-template>
                <ng-template pTemplate="body" let-rowIndex="rowIndex" let-car="$implicit">
                    <tr>
                        <td style="width: 80px" *ngIf="taskTitle != '生产报工查看'">
                            <p-tableCheckbox [value]="car"></p-tableCheckbox>
                        </td>
                        <td style="width: 80px">{{rowIndex+1}}</td>
                        <td style="width: 110px">
                            <div>
                                <p-dropdown (onChange)="unitChangeonlyEv($event.value,car)" [disabled]="taskTitle == '生产报工查看'"
                                    [options]="car.getOrganizationUnitList" dataKey="id"
                                    [(ngModel)]="car.organizationUnitDesc" placeholder="请选择" optionLabel="displayName">
                                </p-dropdown>
                            </div>
                        </td>
                        <td style="width: 110px">
                            <p-dropdown [options]="car.getOrganizationUnitUsersByIdList" dataKey="id" [disabled]="taskTitle == '生产报工查看'"
                                [(ngModel)]="car.userName" placeholder="请选择" optionLabel="name"></p-dropdown>
                        </td>
                        <td style="width: 10px">{{car.performanceHour}}</td>
                        <td style="width: 110px">{{car.reportTime | date:'yyyy-MM-dd'}}</td>
                        <td style="width: 210px">
                            <p-spinner (onChange)="getTableCheckBox(car)" [(ngModel)]="car.reportHour" [disabled]="taskTitle == '生产报工查看'"></p-spinner>
                        </td>
                        <td style="width: 110px" *ngIf="taskTitle != '生产报工查看'">
                            <a (click)="removeEv(car)" href="javascript:;">删除</a>
                        </td>
                    </tr>
                </ng-template>
            </p-table>
        </div>
        <p-footer *ngIf="taskTitle != '生产报工查看'">
            <button type="button" (click)="reportingVisible = false" class="ui-button-secondary" pButton
                label="取消"></button>
            <button type="button" pButton (click)="performanceHourEv(0)" label="工时提报"></button>
            <button type="button" class="ui-button-warning" style="color:#fff" pButton (click)="performanceHourEv(1)"
                label="工时提报结束"></button>
        </p-footer>
    </p-dialog>
    <!-- 履历弹窗 -->
    <p-dialog [style]="{width: '70%', height: '50%',background:'#fff'}" header="操作履历" [(visible)]="llVisible"
        (onHide)="displayclose()" modal="modal" [responsive]="true">
        <p-table [value]="logList" [paginator]="false">
            <ng-template pTemplate="header">
                <tr>
                    <th style="width: 150px">序号</th>
                    <th style="width: 150px">操作时间</th>
                    <th style="width: 150px">操作类型</th>
                    <th style="width: 150px">操作人</th>
                    <th style="width: 150px">操作详情</th>
                </tr>
            </ng-template>
            <ng-template pTemplate="body" let-rowIndex="rowIndex" let-car>
                <tr>
                    <td style="width: 80px">{{rowIndex+1}}</td>
                    <td style="width: 150px">{{car.creationTime | date:'yyyy-MM-dd'}}</td>
                    <td style="width: 150px">{{car.operationTypeDesc}}</td>
                    <td style="width: 150px">{{car.userName}}</td>
                    <td style="width: 150px">{{car.businessTypeDesc}}</td>
                </tr>
            </ng-template>
        </p-table>


    </p-dialog>
    <!-- 维护班组人员 -->
    <p-dialog [style]="{width: '70%', height: '50%',background:'#fff'}" header="维护班组人员" [(visible)]="crewVisible"
        (onHide)="displayclose()" modal="modal" [responsive]="true">
        <div class="ui-g">
            <div class="ui-g-12 add" style="display: flex;">
                <span class="text">装配班组：</span>
                <p-dropdown (onChange)="unitChangeEvSingle($event.value)" filter="true" optionLabel="displayName" dataKey="id"
                    name="organizationUnitId" [options]="getOrganizationUnitList" [(ngModel)]="crewListArr[0]"
                    placeholder="请选择" emptyFilterMessage="暂无数据">
                </p-dropdown>
                <!-- <p-multiSelect (onChange)="unitChangeEv($event.value)" [options]="getOrganizationUnitList"
                    name="organizationUnitId" #organizationUnitIdSelect="ngModel" [(ngModel)]="crewListArr"
                    defaultLabel="请选择" optionLabel="displayName" dataKey="id"></p-multiSelect> -->
            </div>
            <div class="ui-g-12">
                <span class="text">装配人员：</span>
                <div class="ui-g">
                    <div class="ui-g-3" *ngFor="let item of getOrganizationUnitUsersByIdList">
                        <p-checkbox name="groupname" [value]="item.id" [label]="item.name" [(ngModel)]="item.val">
                        </p-checkbox>
                    </div>
                </div>
            </div>
        </div>
        <p-footer>
            <button pButton type="button" (click)="displayclose()" label="取消" class="ui-button-secondary"></button>
            <button pButton type="button" [disabled]="crewListArr[0] == 'undeined'" (click)="defendJobWorkerEv()" label="确定"></button>
        </p-footer>
    </p-dialog>
    <!-- 撤销报工任务 -->
    <p-dialog [style]="{background:'#fff'}" header="任务撤销" [(visible)]="cancelVisible" (onHide)="displayclose()"
        modal="modal" [responsive]="true">
        <div>
            <div>确认撤销报工任务？</div>
            <textarea rows="5" [(ngModel)]="cancelVal" cols="30" pInputTextarea></textarea>
        </div>
        <p-footer>
            <button pButton type="button" (click)="cancelVisible = false" label="取消"
                class="ui-button-secondary"></button>
            <button pButton type="button" (click)="cancelEv()" label="确定"></button>
        </p-footer>
    </p-dialog>
</div>